package com.cql.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import ribbon.RibbonConfiguration;

@RestController
public class AskController {

    @Value("spring.application.name")
    String name;

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/ask")
    public String ask(){
        return restTemplate.getForEntity("http://EUREKA-CLIENT-SERVICE/cql/rest/{name}", String.class, name).getBody();
    }


}
